this.parent({ layout_manager: new Clutter.BinLayout() });
this.connect('destroy', Lang.bind(this, this._onDestroy));
+ this._initialKeyFocus = null;
this._pressedKey = null;
this._buttonKeys = {};
this._createDialog();
return Clutter.EVENT_PROPAGATE;
},
+ get initialKeyFocus() {
+ return this._initialKeyFocus || this;
+ },
+
addContent: function (actor) {
this.contentLayout.add (actor, { expand: true });
},
if (isDefault)
button.add_style_pseudo_class('default');
- if (!this._initialKeyFocusDestroyId)
+ if (this._initialKeyFocus == null || isDefault)
this._initialKeyFocus = button;
for (let i in keys)
}
global.focus_manager.add_group(this.dialogLayout);
- this._initialKeyFocus = this.dialogLayout;
+ this._initialKeyFocus = null;
this._initialKeyFocusDestroyId = 0;
this._savedKeyFocus = null;
},
this._initialKeyFocus = actor;
this._initialKeyFocusDestroyId = actor.connect('destroy', Lang.bind(this, function() {
- this._initialKeyFocus = this.dialogLayout;
+ this._initialKeyFocus = null;
this._initialKeyFocusDestroyId = 0;
}));
},
this._savedKeyFocus.grab_key_focus();
this._savedKeyFocus = null;
} else {
- this._initialKeyFocus.grab_key_focus();
+ let focus = this._initialKeyFocus || this.dialogLayout.initialKeyFocus;
+ focus.grab_key_focus();
}
if (!this._shellReactive)